import request from '@/utils/request'

// 查询出入库日志列表
export function listWarehouse(query) {
  return request({
    url: '/recovery/warehouse/list',
    method: 'get',
    params: query
  })
}

// 查询出入库日志详细
export function getWarehouse(id) {
  return request({
    url: '/recovery/warehouse/' + id,
    method: 'get'
  })
}

// 新增出入库日志
export function addWarehouse(data) {
  return request({
    url: '/recovery/warehouse',
    method: 'post',
    data: data
  })
}

// 修改出入库日志
export function updateWarehouse(data) {
  return request({
    url: '/recovery/warehouse',
    method: 'put',
    data: data
  })
}

// 导出出入库日志
export function exportWarehouse(query) {
  return request({
    url: '/recovery/warehouse/export',
    method: 'get',
    params: query
  })
}

// 导出出入库日志
export function exportWarehouseGoods(query) {
  return request({
    url: '/recovery/warehouse/exportGoods',
    method: 'get',
    params: query
  })
}

// 提交
export function confirmLogs(id) {
  return request({
    url: '/recovery/warehouse/confirm/' + id,
    method: 'put'
  })
}

//取消移交
export function cancelLogs(id) {
  return request({
    url: '/recovery/warehouse/cancel/' + id,
    method: 'put'
  })
}


export function queryGoodsLogList(goodsId) {
  return request({
    url: '/recovery/warehouse/queryGoodsLogList',
    method: 'get',
    params: {goodsId: goodsId}
  })
}
